package chapter5;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description: 计算e
 * Date:2021/4/3
 * ***************************************************************
 */
public class exc5_26 {
	
	private static double value(int n) {
		double item=1.0;
		double e=1.0;
		for(int i=1;i<=n;i++) {
			item=item/(double)i;
			e+=item;
		}
		
		return e;
		
	}
	
	public static void main(String[] args) {
		for(int  i=10000;i<=100000;i+=10000) {
			System.out.printf("n = %d e is: %.6f \n",i,value(i));
		}
		
		
	}
}
